//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS ServiceCatalogAppRegistry service.
///
///  Amazon Web Services Service Catalog AppRegistry enables organizations to understand the application context of their Amazon Web Services resources. AppRegistry provides a repository of your applications, their resources, and the application metadata that you use within your enterprise.
public struct ServiceCatalogAppRegistry: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the ServiceCatalogAppRegistry client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            serviceName: "ServiceCatalogAppRegistry",
            serviceIdentifier: "servicecatalog-appregistry",
            signingName: "servicecatalog",
            serviceProtocol: .restjson,
            apiVersion: "2020-06-24",
            endpoint: endpoint,
            variantEndpoints: Self.variantEndpoints,
            errorType: ServiceCatalogAppRegistryErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }




    /// FIPS and dualstack endpoints
    static var variantEndpoints: [EndpointVariantType: AWSServiceConfig.EndpointVariant] {[
        [.fips]: .init(endpoints: [
            "ca-central-1": "servicecatalog-appregistry-fips.ca-central-1.amazonaws.com",
            "us-east-1": "servicecatalog-appregistry-fips.us-east-1.amazonaws.com",
            "us-east-2": "servicecatalog-appregistry-fips.us-east-2.amazonaws.com",
            "us-gov-east-1": "servicecatalog-appregistry.us-gov-east-1.amazonaws.com",
            "us-gov-west-1": "servicecatalog-appregistry.us-gov-west-1.amazonaws.com",
            "us-west-1": "servicecatalog-appregistry-fips.us-west-1.amazonaws.com",
            "us-west-2": "servicecatalog-appregistry-fips.us-west-2.amazonaws.com"
        ])
    ]}

    // MARK: API Calls

    /// Associates an attribute group with an application to augment the application's metadata with the group's attributes. This feature enables applications to be described with user-defined details that are machine-readable, such as third-party integrations.
    @Sendable
    @inlinable
    public func associateAttributeGroup(_ input: AssociateAttributeGroupRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> AssociateAttributeGroupResponse {
        try await self.client.execute(
            operation: "AssociateAttributeGroup", 
            path: "/applications/{application}/attribute-groups/{attributeGroup}", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Associates an attribute group with an application to augment the application's metadata with the group's attributes. This feature enables applications to be described with user-defined details that are machine-readable, such as third-party integrations.
    ///
    /// Parameters:
    ///   - application:  The name, ID, or ARN  of the application.
    ///   - attributeGroup:  The name, ID, or ARN  of the attribute group  that holds the attributes  to describe the application.
    ///   - logger: Logger use during operation
    @inlinable
    public func associateAttributeGroup(
        application: String,
        attributeGroup: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> AssociateAttributeGroupResponse {
        let input = AssociateAttributeGroupRequest(
            application: application, 
            attributeGroup: attributeGroup
        )
        return try await self.associateAttributeGroup(input, logger: logger)
    }

    ///  Associates a resource with an application.  The resource can be specified by its ARN or name.  The application can be specified by ARN, ID, or name.   Minimum permissions   You must have the following permissions to associate a resource using the OPTIONS parameter set to APPLY_APPLICATION_TAG.     tag:GetResources     tag:TagResources     You must also have these additional permissions if you don't use the AWSServiceCatalogAppRegistryFullAccess policy.  For more information, see AWSServiceCatalogAppRegistryFullAccess in the AppRegistry Administrator Guide.     resource-groups:AssociateResource     cloudformation:UpdateStack     cloudformation:DescribeStacks      In addition, you must have the tagging permission defined by the Amazon Web Services service that creates the resource.  For more information, see TagResources in the Resource Groups Tagging API Reference.
    @Sendable
    @inlinable
    public func associateResource(_ input: AssociateResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> AssociateResourceResponse {
        try await self.client.execute(
            operation: "AssociateResource", 
            path: "/applications/{application}/resources/{resourceType}/{resource}", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Associates a resource with an application.  The resource can be specified by its ARN or name.  The application can be specified by ARN, ID, or name.   Minimum permissions   You must have the following permissions to associate a resource using the OPTIONS parameter set to APPLY_APPLICATION_TAG.     tag:GetResources     tag:TagResources     You must also have these additional permissions if you don't use the AWSServiceCatalogAppRegistryFullAccess policy.  For more information, see AWSServiceCatalogAppRegistryFullAccess in the AppRegistry Administrator Guide.     resource-groups:AssociateResource     cloudformation:UpdateStack     cloudformation:DescribeStacks      In addition, you must have the tagging permission defined by the Amazon Web Services service that creates the resource.  For more information, see TagResources in the Resource Groups Tagging API Reference.
    ///
    /// Parameters:
    ///   - application:  The name, ID, or ARN  of the application.
    ///   - options:  Determines whether an application tag is applied or skipped.
    ///   - resource: The name or ID of the resource of which the application will be associated.
    ///   - resourceType: The type of resource of which the application will be associated.
    ///   - logger: Logger use during operation
    @inlinable
    public func associateResource(
        application: String,
        options: [AssociationOption]? = nil,
        resource: String,
        resourceType: ResourceType,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> AssociateResourceResponse {
        let input = AssociateResourceRequest(
            application: application, 
            options: options, 
            resource: resource, 
            resourceType: resourceType
        )
        return try await self.associateResource(input, logger: logger)
    }

    /// Creates a new application that is the top-level node in a hierarchy of related cloud resource abstractions.
    @Sendable
    @inlinable
    public func createApplication(_ input: CreateApplicationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateApplicationResponse {
        try await self.client.execute(
            operation: "CreateApplication", 
            path: "/applications", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a new application that is the top-level node in a hierarchy of related cloud resource abstractions.
    ///
    /// Parameters:
    ///   - clientToken: A unique identifier that you provide to ensure idempotency. If you retry a request that completed successfully using the same client token and the same parameters, the retry succeeds without performing any further actions. If you retry a successful request using the same client token, but one or more of the parameters are different, the retry fails.
    ///   - description: The description of the application.
    ///   - name: The name of the application. The name must be unique in the region in which you are creating the application.
    ///   - tags: Key-value pairs you can use to associate with the application.
    ///   - logger: Logger use during operation
    @inlinable
    public func createApplication(
        clientToken: String = CreateApplicationRequest.idempotencyToken(),
        description: String? = nil,
        name: String,
        tags: [String: String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateApplicationResponse {
        let input = CreateApplicationRequest(
            clientToken: clientToken, 
            description: description, 
            name: name, 
            tags: tags
        )
        return try await self.createApplication(input, logger: logger)
    }

    /// Creates a new attribute group as a container for user-defined attributes. This feature enables users to have full control over their cloud application's metadata in a rich machine-readable format to facilitate integration with automated workflows and third-party tools.
    @Sendable
    @inlinable
    public func createAttributeGroup(_ input: CreateAttributeGroupRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateAttributeGroupResponse {
        try await self.client.execute(
            operation: "CreateAttributeGroup", 
            path: "/attribute-groups", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates a new attribute group as a container for user-defined attributes. This feature enables users to have full control over their cloud application's metadata in a rich machine-readable format to facilitate integration with automated workflows and third-party tools.
    ///
    /// Parameters:
    ///   - attributes: A JSON string in the form of nested key-value pairs that represent the attributes in the group and describes an application and its components.
    ///   - clientToken: A unique identifier that you provide to ensure idempotency. If you retry a request that completed successfully using the same client token and the same parameters, the retry succeeds without performing any further actions. If you retry a successful request using the same client token, but one or more of the parameters are different, the retry fails.
    ///   - description: The description of the attribute group that the user provides.
    ///   - name: The name of the attribute group.
    ///   - tags: Key-value pairs you can use to associate with the attribute group.
    ///   - logger: Logger use during operation
    @inlinable
    public func createAttributeGroup(
        attributes: String,
        clientToken: String = CreateAttributeGroupRequest.idempotencyToken(),
        description: String? = nil,
        name: String,
        tags: [String: String]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateAttributeGroupResponse {
        let input = CreateAttributeGroupRequest(
            attributes: attributes, 
            clientToken: clientToken, 
            description: description, 
            name: name, 
            tags: tags
        )
        return try await self.createAttributeGroup(input, logger: logger)
    }

    /// Deletes an application that is specified either by its application ID, name, or ARN. All associated attribute groups and resources must be disassociated from it before deleting an application.
    @Sendable
    @inlinable
    public func deleteApplication(_ input: DeleteApplicationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteApplicationResponse {
        try await self.client.execute(
            operation: "DeleteApplication", 
            path: "/applications/{application}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes an application that is specified either by its application ID, name, or ARN. All associated attribute groups and resources must be disassociated from it before deleting an application.
    ///
    /// Parameters:
    ///   - application:  The name, ID, or ARN  of the application.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteApplication(
        application: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteApplicationResponse {
        let input = DeleteApplicationRequest(
            application: application
        )
        return try await self.deleteApplication(input, logger: logger)
    }

    /// Deletes an attribute group, specified either by its attribute group ID, name, or ARN.
    @Sendable
    @inlinable
    public func deleteAttributeGroup(_ input: DeleteAttributeGroupRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DeleteAttributeGroupResponse {
        try await self.client.execute(
            operation: "DeleteAttributeGroup", 
            path: "/attribute-groups/{attributeGroup}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes an attribute group, specified either by its attribute group ID, name, or ARN.
    ///
    /// Parameters:
    ///   - attributeGroup:  The name, ID, or ARN  of the attribute group  that holds the attributes  to describe the application.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteAttributeGroup(
        attributeGroup: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DeleteAttributeGroupResponse {
        let input = DeleteAttributeGroupRequest(
            attributeGroup: attributeGroup
        )
        return try await self.deleteAttributeGroup(input, logger: logger)
    }

    /// Disassociates an attribute group from an application to remove the extra attributes contained in the attribute group from the application's metadata. This operation reverts AssociateAttributeGroup.
    @Sendable
    @inlinable
    public func disassociateAttributeGroup(_ input: DisassociateAttributeGroupRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DisassociateAttributeGroupResponse {
        try await self.client.execute(
            operation: "DisassociateAttributeGroup", 
            path: "/applications/{application}/attribute-groups/{attributeGroup}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Disassociates an attribute group from an application to remove the extra attributes contained in the attribute group from the application's metadata. This operation reverts AssociateAttributeGroup.
    ///
    /// Parameters:
    ///   - application:  The name, ID, or ARN  of the application.
    ///   - attributeGroup:  The name, ID, or ARN  of the attribute group  that holds the attributes  to describe the application.
    ///   - logger: Logger use during operation
    @inlinable
    public func disassociateAttributeGroup(
        application: String,
        attributeGroup: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DisassociateAttributeGroupResponse {
        let input = DisassociateAttributeGroupRequest(
            application: application, 
            attributeGroup: attributeGroup
        )
        return try await self.disassociateAttributeGroup(input, logger: logger)
    }

    ///  Disassociates a resource from application.  Both the resource and the application can be specified either by ID or name.   Minimum permissions   You must have the following permissions to remove a resource that's been associated with an application using the APPLY_APPLICATION_TAG option for AssociateResource.     tag:GetResources     tag:UntagResources     You must also have the following permissions if you don't use the AWSServiceCatalogAppRegistryFullAccess policy.  For more information, see AWSServiceCatalogAppRegistryFullAccess in the AppRegistry Administrator Guide.     resource-groups:DisassociateResource     cloudformation:UpdateStack     cloudformation:DescribeStacks      In addition, you must have the tagging permission defined by the Amazon Web Services service that creates the resource.  For more information, see UntagResources in the Resource Groups Tagging API Reference.
    @Sendable
    @inlinable
    public func disassociateResource(_ input: DisassociateResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> DisassociateResourceResponse {
        try await self.client.execute(
            operation: "DisassociateResource", 
            path: "/applications/{application}/resources/{resourceType}/{resource}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Disassociates a resource from application.  Both the resource and the application can be specified either by ID or name.   Minimum permissions   You must have the following permissions to remove a resource that's been associated with an application using the APPLY_APPLICATION_TAG option for AssociateResource.     tag:GetResources     tag:UntagResources     You must also have the following permissions if you don't use the AWSServiceCatalogAppRegistryFullAccess policy.  For more information, see AWSServiceCatalogAppRegistryFullAccess in the AppRegistry Administrator Guide.     resource-groups:DisassociateResource     cloudformation:UpdateStack     cloudformation:DescribeStacks      In addition, you must have the tagging permission defined by the Amazon Web Services service that creates the resource.  For more information, see UntagResources in the Resource Groups Tagging API Reference.
    ///
    /// Parameters:
    ///   - application: The name or ID of the application.
    ///   - resource: The name or ID of the resource.
    ///   - resourceType: The type of the resource that is being disassociated.
    ///   - logger: Logger use during operation
    @inlinable
    public func disassociateResource(
        application: String,
        resource: String,
        resourceType: ResourceType,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> DisassociateResourceResponse {
        let input = DisassociateResourceRequest(
            application: application, 
            resource: resource, 
            resourceType: resourceType
        )
        return try await self.disassociateResource(input, logger: logger)
    }

    ///  Retrieves metadata information  about one  of your applications.  The application can be specified  by its ARN, ID, or name  (which is unique  within one account  in one region  at a given point  in time).  Specify  by ARN or ID  in automated workflows  if you want  to make sure  that the exact same application is returned or a ResourceNotFoundException is thrown,  avoiding the ABA addressing problem.
    @Sendable
    @inlinable
    public func getApplication(_ input: GetApplicationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetApplicationResponse {
        try await self.client.execute(
            operation: "GetApplication", 
            path: "/applications/{application}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Retrieves metadata information  about one  of your applications.  The application can be specified  by its ARN, ID, or name  (which is unique  within one account  in one region  at a given point  in time).  Specify  by ARN or ID  in automated workflows  if you want  to make sure  that the exact same application is returned or a ResourceNotFoundException is thrown,  avoiding the ABA addressing problem.
    ///
    /// Parameters:
    ///   - application:  The name, ID, or ARN  of the application.
    ///   - logger: Logger use during operation
    @inlinable
    public func getApplication(
        application: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetApplicationResponse {
        let input = GetApplicationRequest(
            application: application
        )
        return try await self.getApplication(input, logger: logger)
    }

    /// Gets the resource associated with the application.
    @Sendable
    @inlinable
    public func getAssociatedResource(_ input: GetAssociatedResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetAssociatedResourceResponse {
        try await self.client.execute(
            operation: "GetAssociatedResource", 
            path: "/applications/{application}/resources/{resourceType}/{resource}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets the resource associated with the application.
    ///
    /// Parameters:
    ///   - application:  The name, ID, or ARN  of the application.
    ///   - maxResults:  The maximum number of results to return. If the parameter is omitted, it defaults to 25. The value is optional.
    ///   - nextToken:  A unique pagination token for each page of results.  Make the call again with the returned token to retrieve the next page of results.
    ///   - resource: The name or ID of the resource associated with the application.
    ///   - resourceTagStatus:  States whether an application tag is applied, not applied, in the process of being applied, or skipped.
    ///   - resourceType: The type of resource associated with the application.
    ///   - logger: Logger use during operation
    @inlinable
    public func getAssociatedResource(
        application: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        resource: String,
        resourceTagStatus: [ResourceItemStatus]? = nil,
        resourceType: ResourceType,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetAssociatedResourceResponse {
        let input = GetAssociatedResourceRequest(
            application: application, 
            maxResults: maxResults, 
            nextToken: nextToken, 
            resource: resource, 
            resourceTagStatus: resourceTagStatus, 
            resourceType: resourceType
        )
        return try await self.getAssociatedResource(input, logger: logger)
    }

    ///  Retrieves an attribute group by its ARN, ID, or name.  The attribute group can be specified  by its ARN, ID, or name.
    @Sendable
    @inlinable
    public func getAttributeGroup(_ input: GetAttributeGroupRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetAttributeGroupResponse {
        try await self.client.execute(
            operation: "GetAttributeGroup", 
            path: "/attribute-groups/{attributeGroup}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Retrieves an attribute group by its ARN, ID, or name.  The attribute group can be specified  by its ARN, ID, or name.
    ///
    /// Parameters:
    ///   - attributeGroup:  The name, ID, or ARN  of the attribute group  that holds the attributes  to describe the application.
    ///   - logger: Logger use during operation
    @inlinable
    public func getAttributeGroup(
        attributeGroup: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetAttributeGroupResponse {
        let input = GetAttributeGroupRequest(
            attributeGroup: attributeGroup
        )
        return try await self.getAttributeGroup(input, logger: logger)
    }

    ///  Retrieves a TagKey configuration from an account.
    @Sendable
    @inlinable
    public func getConfiguration(logger: Logger = AWSClient.loggingDisabled) async throws -> GetConfigurationResponse {
        try await self.client.execute(
            operation: "GetConfiguration", 
            path: "/configuration", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            logger: logger
        )
    }

    /// Retrieves a list of all of your applications. Results are paginated.
    @Sendable
    @inlinable
    public func listApplications(_ input: ListApplicationsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListApplicationsResponse {
        try await self.client.execute(
            operation: "ListApplications", 
            path: "/applications", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves a list of all of your applications. Results are paginated.
    ///
    /// Parameters:
    ///   - maxResults: The upper bound of the number of results to return (cannot exceed 25). If this parameter is omitted, it defaults to 25. This value is optional.
    ///   - nextToken: The token to use to get the next page of results after a previous API call.
    ///   - logger: Logger use during operation
    @inlinable
    public func listApplications(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListApplicationsResponse {
        let input = ListApplicationsRequest(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listApplications(input, logger: logger)
    }

    /// Lists all attribute groups that are associated with specified application.  Results are paginated.
    @Sendable
    @inlinable
    public func listAssociatedAttributeGroups(_ input: ListAssociatedAttributeGroupsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListAssociatedAttributeGroupsResponse {
        try await self.client.execute(
            operation: "ListAssociatedAttributeGroups", 
            path: "/applications/{application}/attribute-groups", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists all attribute groups that are associated with specified application.  Results are paginated.
    ///
    /// Parameters:
    ///   - application: The name or ID of the application.
    ///   - maxResults: The upper bound of the number of results to return (cannot exceed 25). If this parameter is omitted, it defaults to 25. This value is optional.
    ///   - nextToken: The token to use to get the next page of results after a previous API call.
    ///   - logger: Logger use during operation
    @inlinable
    public func listAssociatedAttributeGroups(
        application: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListAssociatedAttributeGroupsResponse {
        let input = ListAssociatedAttributeGroupsRequest(
            application: application, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listAssociatedAttributeGroups(input, logger: logger)
    }

    ///  Lists all  of the resources  that are associated  with the specified application. Results are paginated.    If you share an application,  and a consumer account associates a tag query  to the application,  all of the users  who can access the application  can also view the tag values  in all accounts  that are associated  with it  using this API.
    @Sendable
    @inlinable
    public func listAssociatedResources(_ input: ListAssociatedResourcesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListAssociatedResourcesResponse {
        try await self.client.execute(
            operation: "ListAssociatedResources", 
            path: "/applications/{application}/resources", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Lists all  of the resources  that are associated  with the specified application. Results are paginated.    If you share an application,  and a consumer account associates a tag query  to the application,  all of the users  who can access the application  can also view the tag values  in all accounts  that are associated  with it  using this API.
    ///
    /// Parameters:
    ///   - application:  The name, ID, or ARN  of the application.
    ///   - maxResults: The upper bound of the number of results to return (cannot exceed 25). If this parameter is omitted, it defaults to 25. This value is optional.
    ///   - nextToken: The token to use to get the next page of results after a previous API call.
    ///   - logger: Logger use during operation
    @inlinable
    public func listAssociatedResources(
        application: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListAssociatedResourcesResponse {
        let input = ListAssociatedResourcesRequest(
            application: application, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listAssociatedResources(input, logger: logger)
    }

    /// Lists all attribute groups which you have access to. Results are paginated.
    @Sendable
    @inlinable
    public func listAttributeGroups(_ input: ListAttributeGroupsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListAttributeGroupsResponse {
        try await self.client.execute(
            operation: "ListAttributeGroups", 
            path: "/attribute-groups", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists all attribute groups which you have access to. Results are paginated.
    ///
    /// Parameters:
    ///   - maxResults: The upper bound of the number of results to return (cannot exceed 25). If this parameter is omitted, it defaults to 25. This value is optional.
    ///   - nextToken: The token to use to get the next page of results after a previous API call.
    ///   - logger: Logger use during operation
    @inlinable
    public func listAttributeGroups(
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListAttributeGroupsResponse {
        let input = ListAttributeGroupsRequest(
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listAttributeGroups(input, logger: logger)
    }

    /// Lists the details of all attribute groups associated with a specific application. The results display in pages.
    @Sendable
    @inlinable
    public func listAttributeGroupsForApplication(_ input: ListAttributeGroupsForApplicationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListAttributeGroupsForApplicationResponse {
        try await self.client.execute(
            operation: "ListAttributeGroupsForApplication", 
            path: "/applications/{application}/attribute-group-details", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists the details of all attribute groups associated with a specific application. The results display in pages.
    ///
    /// Parameters:
    ///   - application: The name or ID of the application.
    ///   - maxResults: The upper bound of the number of results to return. The value cannot exceed 25. If you omit this parameter, it defaults to 25. This value is optional.
    ///   - nextToken: This token retrieves the next page of results after a previous API call.
    ///   - logger: Logger use during operation
    @inlinable
    public func listAttributeGroupsForApplication(
        application: String,
        maxResults: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListAttributeGroupsForApplicationResponse {
        let input = ListAttributeGroupsForApplicationRequest(
            application: application, 
            maxResults: maxResults, 
            nextToken: nextToken
        )
        return try await self.listAttributeGroupsForApplication(input, logger: logger)
    }

    /// Lists all of the tags on the resource.
    @Sendable
    @inlinable
    public func listTagsForResource(_ input: ListTagsForResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListTagsForResourceResponse {
        try await self.client.execute(
            operation: "ListTagsForResource", 
            path: "/tags/{resourceArn}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists all of the tags on the resource.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon resource name (ARN) that specifies the resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func listTagsForResource(
        resourceArn: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListTagsForResourceResponse {
        let input = ListTagsForResourceRequest(
            resourceArn: resourceArn
        )
        return try await self.listTagsForResource(input, logger: logger)
    }

    ///  Associates a TagKey configuration  to an account.
    @Sendable
    @inlinable
    public func putConfiguration(_ input: PutConfigurationRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "PutConfiguration", 
            path: "/configuration", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    ///  Associates a TagKey configuration  to an account.
    ///
    /// Parameters:
    ///   - configuration:  Associates a TagKey configuration  to an account.
    ///   - logger: Logger use during operation
    @inlinable
    public func putConfiguration(
        configuration: AppRegistryConfiguration,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = PutConfigurationRequest(
            configuration: configuration
        )
        return try await self.putConfiguration(input, logger: logger)
    }

    /// Syncs the resource with current AppRegistry records. Specifically, the resource’s AppRegistry system tags sync with its associated application. We remove the resource's AppRegistry system tags if it does not associate with the application. The caller must have permissions to read and update the resource.
    @Sendable
    @inlinable
    public func syncResource(_ input: SyncResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> SyncResourceResponse {
        try await self.client.execute(
            operation: "SyncResource", 
            path: "/sync/{resourceType}/{resource}", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Syncs the resource with current AppRegistry records. Specifically, the resource’s AppRegistry system tags sync with its associated application. We remove the resource's AppRegistry system tags if it does not associate with the application. The caller must have permissions to read and update the resource.
    ///
    /// Parameters:
    ///   - resource: An entity you can work with and specify with a name or ID. Examples include an Amazon EC2 instance, an Amazon Web Services CloudFormation stack, or an Amazon S3 bucket.
    ///   - resourceType: The type of resource of which the application will be associated.
    ///   - logger: Logger use during operation
    @inlinable
    public func syncResource(
        resource: String,
        resourceType: ResourceType,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> SyncResourceResponse {
        let input = SyncResourceRequest(
            resource: resource, 
            resourceType: resourceType
        )
        return try await self.syncResource(input, logger: logger)
    }

    /// Assigns one or more tags (key-value pairs) to the specified resource. Each tag consists of a key and an optional value. If a tag with the same key is already associated with the resource, this action updates its value. This operation returns an empty response if the call was successful.
    @Sendable
    @inlinable
    public func tagResource(_ input: TagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> TagResourceResponse {
        try await self.client.execute(
            operation: "TagResource", 
            path: "/tags/{resourceArn}", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Assigns one or more tags (key-value pairs) to the specified resource. Each tag consists of a key and an optional value. If a tag with the same key is already associated with the resource, this action updates its value. This operation returns an empty response if the call was successful.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon resource name (ARN) that specifies the resource.
    ///   - tags: The new or modified tags for the resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func tagResource(
        resourceArn: String,
        tags: [String: String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> TagResourceResponse {
        let input = TagResourceRequest(
            resourceArn: resourceArn, 
            tags: tags
        )
        return try await self.tagResource(input, logger: logger)
    }

    /// Removes tags from a resource. This operation returns an empty response if the call was successful.
    @Sendable
    @inlinable
    public func untagResource(_ input: UntagResourceRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UntagResourceResponse {
        try await self.client.execute(
            operation: "UntagResource", 
            path: "/tags/{resourceArn}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Removes tags from a resource. This operation returns an empty response if the call was successful.
    ///
    /// Parameters:
    ///   - resourceArn: The Amazon resource name (ARN) that specifies the resource.
    ///   - tagKeys: A list of the tag keys to remove from the specified resource.
    ///   - logger: Logger use during operation
    @inlinable
    public func untagResource(
        resourceArn: String,
        tagKeys: [String],
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UntagResourceResponse {
        let input = UntagResourceRequest(
            resourceArn: resourceArn, 
            tagKeys: tagKeys
        )
        return try await self.untagResource(input, logger: logger)
    }

    /// Updates an existing application with new attributes.
    @Sendable
    @inlinable
    public func updateApplication(_ input: UpdateApplicationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateApplicationResponse {
        try await self.client.execute(
            operation: "UpdateApplication", 
            path: "/applications/{application}", 
            httpMethod: .PATCH, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates an existing application with new attributes.
    ///
    /// Parameters:
    ///   - application:  The name, ID, or ARN  of the application  that will be updated.
    ///   - description: The new description of the application.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateApplication(
        application: String,
        description: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateApplicationResponse {
        let input = UpdateApplicationRequest(
            application: application, 
            description: description
        )
        return try await self.updateApplication(input, logger: logger)
    }

    /// Updates an existing attribute group with new details.
    @Sendable
    @inlinable
    public func updateAttributeGroup(_ input: UpdateAttributeGroupRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateAttributeGroupResponse {
        try await self.client.execute(
            operation: "UpdateAttributeGroup", 
            path: "/attribute-groups/{attributeGroup}", 
            httpMethod: .PATCH, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates an existing attribute group with new details.
    ///
    /// Parameters:
    ///   - attributeGroup:  The name, ID, or ARN  of the attribute group  that holds the attributes  to describe the application.
    ///   - attributes: A JSON string in the form of nested key-value pairs that represent the attributes in the group and describes an application and its components.
    ///   - description: The description of the attribute group that the user provides.
    ///   - logger: Logger use during operation
    @inlinable
    public func updateAttributeGroup(
        attributeGroup: String,
        attributes: String? = nil,
        description: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateAttributeGroupResponse {
        let input = UpdateAttributeGroupRequest(
            attributeGroup: attributeGroup, 
            attributes: attributes, 
            description: description
        )
        return try await self.updateAttributeGroup(input, logger: logger)
    }
}

extension ServiceCatalogAppRegistry {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: ServiceCatalogAppRegistry, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension ServiceCatalogAppRegistry {
    /// Return PaginatorSequence for operation ``listApplications(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listApplicationsPaginator(
        _ input: ListApplicationsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListApplicationsRequest, ListApplicationsResponse> {
        return .init(
            input: input,
            command: self.listApplications,
            inputKey: \ListApplicationsRequest.nextToken,
            outputKey: \ListApplicationsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listApplications(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: The upper bound of the number of results to return (cannot exceed 25). If this parameter is omitted, it defaults to 25. This value is optional.
    ///   - logger: Logger used for logging
    @inlinable
    public func listApplicationsPaginator(
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListApplicationsRequest, ListApplicationsResponse> {
        let input = ListApplicationsRequest(
            maxResults: maxResults
        )
        return self.listApplicationsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listAssociatedAttributeGroups(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listAssociatedAttributeGroupsPaginator(
        _ input: ListAssociatedAttributeGroupsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListAssociatedAttributeGroupsRequest, ListAssociatedAttributeGroupsResponse> {
        return .init(
            input: input,
            command: self.listAssociatedAttributeGroups,
            inputKey: \ListAssociatedAttributeGroupsRequest.nextToken,
            outputKey: \ListAssociatedAttributeGroupsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listAssociatedAttributeGroups(_:logger:)``.
    ///
    /// - Parameters:
    ///   - application: The name or ID of the application.
    ///   - maxResults: The upper bound of the number of results to return (cannot exceed 25). If this parameter is omitted, it defaults to 25. This value is optional.
    ///   - logger: Logger used for logging
    @inlinable
    public func listAssociatedAttributeGroupsPaginator(
        application: String,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListAssociatedAttributeGroupsRequest, ListAssociatedAttributeGroupsResponse> {
        let input = ListAssociatedAttributeGroupsRequest(
            application: application, 
            maxResults: maxResults
        )
        return self.listAssociatedAttributeGroupsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listAssociatedResources(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listAssociatedResourcesPaginator(
        _ input: ListAssociatedResourcesRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListAssociatedResourcesRequest, ListAssociatedResourcesResponse> {
        return .init(
            input: input,
            command: self.listAssociatedResources,
            inputKey: \ListAssociatedResourcesRequest.nextToken,
            outputKey: \ListAssociatedResourcesResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listAssociatedResources(_:logger:)``.
    ///
    /// - Parameters:
    ///   - application:  The name, ID, or ARN  of the application.
    ///   - maxResults: The upper bound of the number of results to return (cannot exceed 25). If this parameter is omitted, it defaults to 25. This value is optional.
    ///   - logger: Logger used for logging
    @inlinable
    public func listAssociatedResourcesPaginator(
        application: String,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListAssociatedResourcesRequest, ListAssociatedResourcesResponse> {
        let input = ListAssociatedResourcesRequest(
            application: application, 
            maxResults: maxResults
        )
        return self.listAssociatedResourcesPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listAttributeGroups(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listAttributeGroupsPaginator(
        _ input: ListAttributeGroupsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListAttributeGroupsRequest, ListAttributeGroupsResponse> {
        return .init(
            input: input,
            command: self.listAttributeGroups,
            inputKey: \ListAttributeGroupsRequest.nextToken,
            outputKey: \ListAttributeGroupsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listAttributeGroups(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxResults: The upper bound of the number of results to return (cannot exceed 25). If this parameter is omitted, it defaults to 25. This value is optional.
    ///   - logger: Logger used for logging
    @inlinable
    public func listAttributeGroupsPaginator(
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListAttributeGroupsRequest, ListAttributeGroupsResponse> {
        let input = ListAttributeGroupsRequest(
            maxResults: maxResults
        )
        return self.listAttributeGroupsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listAttributeGroupsForApplication(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listAttributeGroupsForApplicationPaginator(
        _ input: ListAttributeGroupsForApplicationRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListAttributeGroupsForApplicationRequest, ListAttributeGroupsForApplicationResponse> {
        return .init(
            input: input,
            command: self.listAttributeGroupsForApplication,
            inputKey: \ListAttributeGroupsForApplicationRequest.nextToken,
            outputKey: \ListAttributeGroupsForApplicationResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listAttributeGroupsForApplication(_:logger:)``.
    ///
    /// - Parameters:
    ///   - application: The name or ID of the application.
    ///   - maxResults: The upper bound of the number of results to return. The value cannot exceed 25. If you omit this parameter, it defaults to 25. This value is optional.
    ///   - logger: Logger used for logging
    @inlinable
    public func listAttributeGroupsForApplicationPaginator(
        application: String,
        maxResults: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListAttributeGroupsForApplicationRequest, ListAttributeGroupsForApplicationResponse> {
        let input = ListAttributeGroupsForApplicationRequest(
            application: application, 
            maxResults: maxResults
        )
        return self.listAttributeGroupsForApplicationPaginator(input, logger: logger)
    }
}

extension ServiceCatalogAppRegistry.ListApplicationsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> ServiceCatalogAppRegistry.ListApplicationsRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension ServiceCatalogAppRegistry.ListAssociatedAttributeGroupsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> ServiceCatalogAppRegistry.ListAssociatedAttributeGroupsRequest {
        return .init(
            application: self.application,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension ServiceCatalogAppRegistry.ListAssociatedResourcesRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> ServiceCatalogAppRegistry.ListAssociatedResourcesRequest {
        return .init(
            application: self.application,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension ServiceCatalogAppRegistry.ListAttributeGroupsForApplicationRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> ServiceCatalogAppRegistry.ListAttributeGroupsForApplicationRequest {
        return .init(
            application: self.application,
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}

extension ServiceCatalogAppRegistry.ListAttributeGroupsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> ServiceCatalogAppRegistry.ListAttributeGroupsRequest {
        return .init(
            maxResults: self.maxResults,
            nextToken: token
        )
    }
}
